{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">分类管理</li>
            <li class=""><a href="{:url('admin/store_classify2/add')}">添加分类</a></li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form layui-form-pane" action="{:url('admin/store_classify2/index')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">所属栏目</label>
                        <div class="layui-input-inline">
                            <select name="pid">
                                <option value="0">全部</option>
                                {foreach name="storeclassify_level_list" item="vo"}
                                <option value="{$vo.id}" {if condition="$pid==$vo.id"} selected="selected"{/if}>{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline"  style="margin-bottom: 5px;">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th style="width: 30px;">排序</th>
                        <th>分类名称</th>
                        <th>所属栏目</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="storeclassify_list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.sort}</td>
                        <td>{$vo.name}</td>
                        <td>
                        {foreach name="storeclassify_level_list" item="lo"}
                        {if $vo.pid == $lo.id}
                        {$lo.name}
                        {/if}
                        {/foreach}
                        </td>
                        <td>
                            <a href="{:url('admin/store_classify2/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                            <a href="{:url('admin/store_classify2/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$storeclassify_list->render()}
            </div>
        </div>
    </div>
</div>
{/block}